﻿@model PagedList.IPagedList<Pageparkproject.Models.tblNew>
@using PagedList.Mvc;
@{
    ViewBag.Title = "NewsManage";
    Layout = "~/Views/Shared/AdminLayoutPage.cshtml";
    ViewBag.News = "current";
    <link href="~/Content/PagedList.css" rel="stylesheet" />
    <script src="~/Contents/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Contents/Admin/Script.js"></script>
    <script src="~/Contents/Admin/Theme/jconfirmaction.jquery.js"></script>
    <script src="~/Contents/Admin/ckeditor/ckeditor.js"></script>
}
<script type="text/javascript">
   
</script>

<div class="form">
    <a href="#" class="bt_red" onclick="closeForm();"><span class="bt_red_lft"></span><strong>Close form</strong><span class="bt_red_r"></span></a>
    <form action="/Admin/NewsCreate" enctype="multipart/form-data" method="post" id="newsForm">
        @Html.Hidden("PK_iNewsID", "", new { @class = "PK_iNewsID" })
        @Html.Hidden("dDatepost", "", new { @class = "dDatepost" })
        @Html.Hidden("sAnh", "", new { @class = "sAnh" })
        <fieldset>
            <dt>
                    <label for="category">Category:</label>
                </dt>
                <dd>
                    <select size="1" name="FK_iCategoryNewsID" id="newsCategory">
                    </select>
                </dd>
            <dl>
                <dt>
                    <label for="sTieude">Tiêu đề:</label></dt>
                <dd>
                    <input type="text" name="sTieude" id="sTieude" size="40" /></dd>
            </dl>
            <dl>
                <dt>
                    <label for="sTomtat">Tóm tắt:</label></dt>
                <dd>
                    <textarea name="sTomtat" id="sTomtat" rows="3" style="width:300px;" ></textarea></dd>
            </dl>
            <dl>
                <dt>
                    <label for="color">Trạng thái hiển thị</label></dt>
                <dd>
                    <input type="radio" name="bStatus" id="statusTrue" value="True" checked="checked" /><label class="check_label">Hiện</label>
                    <input type="radio" name="bStatus" id="statusFalse" value="False" /><label class="check_label">Ẩn</label>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label for="upload">Images files:</label></dt>
                <dd>
                    <input type="file" name="files" id="upload" /></dd>
                <dd id="newsImages">
                    
                </dd>
            </dl>
            <dl>
                <dt>
                    <label for="sNoidung">Nội dung:</label></dt>
                <dd>
                    <textarea name="sNoidung" id="sNoidung" class="sNoidung" rows="5" cols="36"></textarea></dd>
            </dl>
            <dl class="submit">
                <dd>
                    <input type="submit" name="submit" id="submit" value="Submit" /></dd>

            </dl>
        </fieldset>

    </form>
</div>
<h2>Products Categories Settings</h2>
<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
    <thead>
        <tr>
            <th scope="col" class="rounded-company"></th>
            <th scope="col" class="rounded">Tiêu đề</th>
            <th scope="col" class="rounded">Tóm tắt</th>
            <th scope="col" class="rounded">Trạng thái</th>
            <th scope="col" class="rounded">Edit</th>
            <th scope="col" class="rounded-q4">Delete</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="6" class="rounded-foot-left">
                @Html.PagedListPager(Model, page => Url.Action("NewsManage", new { page }))</td>
            <td class="rounded-foot-right">&nbsp;</td>
        </tr>
    </tfoot>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" name="" /></td>
                <td>
                    @item.sTieude
                <td>@item.sTomtat</td>
                <td>@if (item.bStatus == true)
                    {<a href="@Url.Action("NewsChangeStatus")">Hiện</a> }
                    else
                    { <a href="@Url.Action("NewsChangeStatus")">Ẩn</a> }</td>
                <td><a href="#" onclick="newsEdit(@item.PK_iNewsID);">
                    <img src="~/Contents/Admin/Theme/images/user_edit.png" alt="" title="" border="0" /></a></td>
                <td><a href="@Url.Action("NewsDelete", new { id = item.PK_iNewsID })" class="ask">
                    <img src="~/Contents/Admin/Theme/images/trash.png" alt="" title="" border="0" /></a></td>
            </tr>
        }
    </tbody>
</table>

<a href="#" class="bt_green" onclick="newsCreate();"><span class="bt_green_lft"></span><strong>Add new item</strong><span class="bt_green_r"></span></a>
<a href="#" class="bt_blue"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a>
<a href="#" class="bt_red"><span class="bt_red_lft"></span><strong>Delete items</strong><span class="bt_red_r"></span></a>
